Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

339
Views
"web_accessible_resources" manifest key is ignored if respective resources are injected into a file URL page

Recently my MV3 extension stopped working (although it was working before). After some research I found out that injected scripts/CSS fail to load despite they're listed in web_accessible_resources manifest key. These necessary resources are injected by my content script via document.createElement. It's worth noting that this problem only arises if these resources are injected into a page with a local file (file://) opened; there is no problem on http:// pages.

I get net::ERR_BLOCKED_BY_CLIENT error for all injected resources: Blocked Error message

Below is "web_accessible_resources" key in my manifest:

...
"web_accessible_resources": [
  {
    "resources": [
      "harviewer/*",
      "connection.js"
    ],
    "matches": [
      "<all_urls>"
    ]
  }
],
...

AFAIU it is correct, otherwise I'd get another error message like this: enter image description here

"Allow access to file URLS" checkbox is checked for the extension: enter image description here

I have no adblock-like extensions installed. Also I've tried to clear browser cache, with no luck.

So is it a bug or a feature? The current Chrome Dev docs don't mention such behaviour.

I've made a MCVE that reproduces the problem.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Yes, confirming this nasty behaviour in MV3 for file://* scheme.. Sounds like a Chrome's CSP bug when accessing resources from local files..

As workaround we can simply proxying all global.fetch() requests to our service-worker (aka background-page in MV2) with chrome.runtime.sendMessage(message, callback) and then return content as a plain/base64 string.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!